<?php
/**
 * common repository file Created by PhpStorm.
 * User: wumengmeng
 * Date: 2020/03/18
 * Time: 15:26
 */

namespace HiCommon\Repository;

use HiCommon\Model\MaintainVehicleModel;

class MaintainVehicleModelRepository extends BaseRepository
{
    public function base_model()
    {
        return new \HiCommon\Model\MaintainVehicleModel();
    }

    public function get_all($arr_option = [])
    {
        return MaintainVehicleModel::commonget($arr_option);
    }

    /**
     * 添加多条数据
     *
     * @param array $arr_data
     *
     * @return mixed
     * @author wumengmeng <wu_mengmeng@foxmail.com>
     */
    public function add_many($arr_data)
    {
        return MaintainVehicleModel::insert($arr_data);
    }

    /**
     * 根据条件批量删除信息
     *
     * @param array $arr_where
     * @param bool $method
     *
     * @return mixed
     * @author wumengmeng <wu_mengmeng@foxmail.com>
     */
    public function delete_by_where($arr_where = [], $method = true)
    {
        return MaintainVehicleModel::where($arr_where)->commondelete($method);
    }

    public function delete_by_where_in($arr_where = [], $method = true)
    {
        return MaintainVehicleModel::whereIn('maintain_shop_id', $arr_where)->commondelete($method);
    }
}